//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_spi(SotoInternal) import SotoCore

extension BCMDataExports {
    // MARK: Enums

    public enum CompressionOption: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case gzip = "GZIP"
        case parquet = "PARQUET"
        public var description: String { return self.rawValue }
    }

    public enum ExecutionStatusCode: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case deliveryFailure = "DELIVERY_FAILURE"
        case deliveryInProcess = "DELIVERY_IN_PROCESS"
        case deliverySuccess = "DELIVERY_SUCCESS"
        case initiationInProcess = "INITIATION_IN_PROCESS"
        case queryFailure = "QUERY_FAILURE"
        case queryInProcess = "QUERY_IN_PROCESS"
        case queryQueued = "QUERY_QUEUED"
        public var description: String { return self.rawValue }
    }

    public enum ExecutionStatusReason: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case billOwnerChanged = "BILL_OWNER_CHANGED"
        case insufficientPermission = "INSUFFICIENT_PERMISSION"
        case internalFailure = "INTERNAL_FAILURE"
        public var description: String { return self.rawValue }
    }

    public enum ExportStatusCode: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case healthy = "HEALTHY"
        case unhealthy = "UNHEALTHY"
        public var description: String { return self.rawValue }
    }

    public enum FormatOption: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case parquet = "PARQUET"
        case textOrCsv = "TEXT_OR_CSV"
        public var description: String { return self.rawValue }
    }

    public enum FrequencyOption: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case synchronous = "SYNCHRONOUS"
        public var description: String { return self.rawValue }
    }

    public enum OverwriteOption: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case createNewReport = "CREATE_NEW_REPORT"
        case overwriteReport = "OVERWRITE_REPORT"
        public var description: String { return self.rawValue }
    }

    public enum S3OutputType: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case custom = "CUSTOM"
        public var description: String { return self.rawValue }
    }

    public enum ValidationExceptionReason: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case cannotParse = "cannotParse"
        case fieldValidationFailed = "fieldValidationFailed"
        case other = "other"
        case unknownOperation = "unknownOperation"
        public var description: String { return self.rawValue }
    }

    // MARK: Shapes

    public struct Column: AWSDecodableShape {
        /// The description for a column.
        public let description: String?
        /// The column name.
        public let name: String?
        /// The kind of data a column stores.
        public let type: String?

        @inlinable
        public init(description: String? = nil, name: String? = nil, type: String? = nil) {
            self.description = description
            self.name = name
            self.type = type
        }

        private enum CodingKeys: String, CodingKey {
            case description = "Description"
            case name = "Name"
            case type = "Type"
        }
    }

    public struct CreateExportRequest: AWSEncodableShape {
        /// The details of the export, including data query, name, description, and destination configuration.
        public let export: Export
        /// An optional list of tags to associate with the specified export. Each tag consists of a key and a value, and each key must be unique for the resource.
        public let resourceTags: [ResourceTag]?

        @inlinable
        public init(export: Export, resourceTags: [ResourceTag]? = nil) {
            self.export = export
            self.resourceTags = resourceTags
        }

        public func validate(name: String) throws {
            try self.export.validate(name: "\(name).export")
            try self.resourceTags?.forEach {
                try $0.validate(name: "\(name).resourceTags[]")
            }
            try self.validate(self.resourceTags, name: "resourceTags", parent: name, max: 200)
        }

        private enum CodingKeys: String, CodingKey {
            case export = "Export"
            case resourceTags = "ResourceTags"
        }
    }

    public struct CreateExportResponse: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) for this export.
        public let exportArn: String?

        @inlinable
        public init(exportArn: String? = nil) {
            self.exportArn = exportArn
        }

        private enum CodingKeys: String, CodingKey {
            case exportArn = "ExportArn"
        }
    }

    public struct DataQuery: AWSEncodableShape & AWSDecodableShape {
        /// The query statement.
        public let queryStatement: String
        /// The table configuration.
        public let tableConfigurations: [String: [String: String]]?

        @inlinable
        public init(queryStatement: String, tableConfigurations: [String: [String: String]]? = nil) {
            self.queryStatement = queryStatement
            self.tableConfigurations = tableConfigurations
        }

        public func validate(name: String) throws {
            try self.validate(self.queryStatement, name: "queryStatement", parent: name, max: 36000)
            try self.validate(self.queryStatement, name: "queryStatement", parent: name, min: 1)
            try self.validate(self.queryStatement, name: "queryStatement", parent: name, pattern: "^[\\S\\s]*$")
            try self.tableConfigurations?.forEach {
                try validate($0.key, name: "tableConfigurations.key", parent: name, max: 1024)
                try validate($0.key, name: "tableConfigurations.key", parent: name, pattern: "^[\\S\\s]*$")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case queryStatement = "QueryStatement"
            case tableConfigurations = "TableConfigurations"
        }
    }

    public struct DeleteExportRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) for this export.
        public let exportArn: String

        @inlinable
        public init(exportArn: String) {
            self.exportArn = exportArn
        }

        public func validate(name: String) throws {
            try self.validate(self.exportArn, name: "exportArn", parent: name, max: 2048)
            try self.validate(self.exportArn, name: "exportArn", parent: name, min: 20)
            try self.validate(self.exportArn, name: "exportArn", parent: name, pattern: "^arn:aws[-a-z0-9]*:[-a-z0-9]+:[-a-z0-9]*:[0-9]{12}:[-a-zA-Z0-9/:_]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case exportArn = "ExportArn"
        }
    }

    public struct DeleteExportResponse: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) for this export.
        public let exportArn: String?

        @inlinable
        public init(exportArn: String? = nil) {
            self.exportArn = exportArn
        }

        private enum CodingKeys: String, CodingKey {
            case exportArn = "ExportArn"
        }
    }

    public struct DestinationConfigurations: AWSEncodableShape & AWSDecodableShape {
        /// An object that describes the destination of the data exports file.
        public let s3Destination: S3Destination

        @inlinable
        public init(s3Destination: S3Destination) {
            self.s3Destination = s3Destination
        }

        public func validate(name: String) throws {
            try self.s3Destination.validate(name: "\(name).s3Destination")
        }

        private enum CodingKeys: String, CodingKey {
            case s3Destination = "S3Destination"
        }
    }

    public struct ExecutionReference: AWSDecodableShape {
        /// The ID for this specific execution.
        public let executionId: String
        /// The status of this specific execution.
        public let executionStatus: ExecutionStatus

        @inlinable
        public init(executionId: String, executionStatus: ExecutionStatus) {
            self.executionId = executionId
            self.executionStatus = executionStatus
        }

        private enum CodingKeys: String, CodingKey {
            case executionId = "ExecutionId"
            case executionStatus = "ExecutionStatus"
        }
    }

    public struct ExecutionStatus: AWSDecodableShape {
        /// The time when the execution was completed.
        public let completedAt: Date?
        /// The time when the execution was created.
        public let createdAt: Date?
        /// The time when the execution was last updated.
        public let lastUpdatedAt: Date?
        /// The code for the status of the execution.
        public let statusCode: ExecutionStatusCode?
        /// The reason for the failed status.
        public let statusReason: ExecutionStatusReason?

        @inlinable
        public init(completedAt: Date? = nil, createdAt: Date? = nil, lastUpdatedAt: Date? = nil, statusCode: ExecutionStatusCode? = nil, statusReason: ExecutionStatusReason? = nil) {
            self.completedAt = completedAt
            self.createdAt = createdAt
            self.lastUpdatedAt = lastUpdatedAt
            self.statusCode = statusCode
            self.statusReason = statusReason
        }

        private enum CodingKeys: String, CodingKey {
            case completedAt = "CompletedAt"
            case createdAt = "CreatedAt"
            case lastUpdatedAt = "LastUpdatedAt"
            case statusCode = "StatusCode"
            case statusReason = "StatusReason"
        }
    }

    public struct Export: AWSEncodableShape & AWSDecodableShape {
        /// The data query for this specific data export.
        public let dataQuery: DataQuery
        /// The description for this specific data export.
        public let description: String?
        /// The destination configuration for this specific data export.
        public let destinationConfigurations: DestinationConfigurations
        /// The Amazon Resource Name (ARN) for this export.
        public let exportArn: String?
        /// The name of this specific data export.
        public let name: String
        /// The cadence for Amazon Web Services to update the export in your S3 bucket.
        public let refreshCadence: RefreshCadence

        @inlinable
        public init(dataQuery: DataQuery, description: String? = nil, destinationConfigurations: DestinationConfigurations, exportArn: String? = nil, name: String, refreshCadence: RefreshCadence) {
            self.dataQuery = dataQuery
            self.description = description
            self.destinationConfigurations = destinationConfigurations
            self.exportArn = exportArn
            self.name = name
            self.refreshCadence = refreshCadence
        }

        public func validate(name: String) throws {
            try self.dataQuery.validate(name: "\(name).dataQuery")
            try self.validate(self.description, name: "description", parent: name, max: 1024)
            try self.validate(self.description, name: "description", parent: name, pattern: "^[\\S\\s]*$")
            try self.destinationConfigurations.validate(name: "\(name).destinationConfigurations")
            try self.validate(self.exportArn, name: "exportArn", parent: name, max: 2048)
            try self.validate(self.exportArn, name: "exportArn", parent: name, min: 20)
            try self.validate(self.exportArn, name: "exportArn", parent: name, pattern: "^arn:aws[-a-z0-9]*:[-a-z0-9]+:[-a-z0-9]*:[0-9]{12}:[-a-zA-Z0-9/:_]+$")
            try self.validate(self.name, name: "name", parent: name, max: 128)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[0-9A-Za-z!\\-_.*\\'()]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case dataQuery = "DataQuery"
            case description = "Description"
            case destinationConfigurations = "DestinationConfigurations"
            case exportArn = "ExportArn"
            case name = "Name"
            case refreshCadence = "RefreshCadence"
        }
    }

    public struct ExportReference: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) for this export.
        public let exportArn: String
        /// The name of this specific data export.
        public let exportName: String
        /// The status of this specific data export.
        public let exportStatus: ExportStatus

        @inlinable
        public init(exportArn: String, exportName: String, exportStatus: ExportStatus) {
            self.exportArn = exportArn
            self.exportName = exportName
            self.exportStatus = exportStatus
        }

        private enum CodingKeys: String, CodingKey {
            case exportArn = "ExportArn"
            case exportName = "ExportName"
            case exportStatus = "ExportStatus"
        }
    }

    public struct ExportStatus: AWSDecodableShape {
        /// The timestamp of when the export  was created.
        public let createdAt: Date?
        /// The timestamp of when the export was last generated.
        public let lastRefreshedAt: Date?
        /// The timestamp of when the export  was updated.
        public let lastUpdatedAt: Date?
        /// The status code for the request.
        public let statusCode: ExportStatusCode?
        /// The description for the status code.
        public let statusReason: ExecutionStatusReason?

        @inlinable
        public init(createdAt: Date? = nil, lastRefreshedAt: Date? = nil, lastUpdatedAt: Date? = nil, statusCode: ExportStatusCode? = nil, statusReason: ExecutionStatusReason? = nil) {
            self.createdAt = createdAt
            self.lastRefreshedAt = lastRefreshedAt
            self.lastUpdatedAt = lastUpdatedAt
            self.statusCode = statusCode
            self.statusReason = statusReason
        }

        private enum CodingKeys: String, CodingKey {
            case createdAt = "CreatedAt"
            case lastRefreshedAt = "LastRefreshedAt"
            case lastUpdatedAt = "LastUpdatedAt"
            case statusCode = "StatusCode"
            case statusReason = "StatusReason"
        }
    }

    public struct GetExecutionRequest: AWSEncodableShape {
        /// The ID for this specific execution.
        public let executionId: String
        /// The Amazon Resource Name (ARN) of the Export object that generated this specific execution.
        public let exportArn: String

        @inlinable
        public init(executionId: String, exportArn: String) {
            self.executionId = executionId
            self.exportArn = exportArn
        }

        public func validate(name: String) throws {
            try self.validate(self.executionId, name: "executionId", parent: name, max: 1024)
            try self.validate(self.executionId, name: "executionId", parent: name, pattern: "^[\\S\\s]*$")
            try self.validate(self.exportArn, name: "exportArn", parent: name, max: 2048)
            try self.validate(self.exportArn, name: "exportArn", parent: name, min: 20)
            try self.validate(self.exportArn, name: "exportArn", parent: name, pattern: "^arn:aws[-a-z0-9]*:[-a-z0-9]+:[-a-z0-9]*:[0-9]{12}:[-a-zA-Z0-9/:_]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case executionId = "ExecutionId"
            case exportArn = "ExportArn"
        }
    }

    public struct GetExecutionResponse: AWSDecodableShape {
        /// The ID for this specific execution.
        public let executionId: String?
        /// The status of this specific execution.
        public let executionStatus: ExecutionStatus?
        /// The export data for this specific execution. This export data is a snapshot from when the execution was generated. The data could be different from the current export data if the export was updated since the execution was generated.
        public let export: Export?

        @inlinable
        public init(executionId: String? = nil, executionStatus: ExecutionStatus? = nil, export: Export? = nil) {
            self.executionId = executionId
            self.executionStatus = executionStatus
            self.export = export
        }

        private enum CodingKeys: String, CodingKey {
            case executionId = "ExecutionId"
            case executionStatus = "ExecutionStatus"
            case export = "Export"
        }
    }

    public struct GetExportRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) for this export.
        public let exportArn: String

        @inlinable
        public init(exportArn: String) {
            self.exportArn = exportArn
        }

        public func validate(name: String) throws {
            try self.validate(self.exportArn, name: "exportArn", parent: name, max: 2048)
            try self.validate(self.exportArn, name: "exportArn", parent: name, min: 20)
            try self.validate(self.exportArn, name: "exportArn", parent: name, pattern: "^arn:aws[-a-z0-9]*:[-a-z0-9]+:[-a-z0-9]*:[0-9]{12}:[-a-zA-Z0-9/:_]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case exportArn = "ExportArn"
        }
    }

    public struct GetExportResponse: AWSDecodableShape {
        /// The data for this specific export.
        public let export: Export?
        /// The status of this specific export.
        public let exportStatus: ExportStatus?

        @inlinable
        public init(export: Export? = nil, exportStatus: ExportStatus? = nil) {
            self.export = export
            self.exportStatus = exportStatus
        }

        private enum CodingKeys: String, CodingKey {
            case export = "Export"
            case exportStatus = "ExportStatus"
        }
    }

    public struct GetTableRequest: AWSEncodableShape {
        /// The name of the table.
        public let tableName: String
        /// TableProperties are additional configurations you can provide to change the data and schema of a table. Each table can have different TableProperties. Tables are not required to have any TableProperties. Each table property has a default value that it assumes if not specified.
        public let tableProperties: [String: String]?

        @inlinable
        public init(tableName: String, tableProperties: [String: String]? = nil) {
            self.tableName = tableName
            self.tableProperties = tableProperties
        }

        public func validate(name: String) throws {
            try self.validate(self.tableName, name: "tableName", parent: name, max: 1024)
            try self.validate(self.tableName, name: "tableName", parent: name, pattern: "^[\\S\\s]*$")
            try self.tableProperties?.forEach {
                try validate($0.key, name: "tableProperties.key", parent: name, max: 1024)
                try validate($0.key, name: "tableProperties.key", parent: name, pattern: "^[\\S\\s]*$")
                try validate($0.value, name: "tableProperties[\"\($0.key)\"]", parent: name, max: 1024)
                try validate($0.value, name: "tableProperties[\"\($0.key)\"]", parent: name, pattern: "^[\\S\\s]*$")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case tableName = "TableName"
            case tableProperties = "TableProperties"
        }
    }

    public struct GetTableResponse: AWSDecodableShape {
        /// The table description.
        public let description: String?
        /// The schema of the table.
        public let schema: [Column]?
        /// The name of the table.
        public let tableName: String?
        /// TableProperties are additional configurations you can provide to change the data and schema of a table. Each table can have different TableProperties. Tables are not required to have any TableProperties. Each table property has a default value that it assumes if not specified.
        public let tableProperties: [String: String]?

        @inlinable
        public init(description: String? = nil, schema: [Column]? = nil, tableName: String? = nil, tableProperties: [String: String]? = nil) {
            self.description = description
            self.schema = schema
            self.tableName = tableName
            self.tableProperties = tableProperties
        }

        private enum CodingKeys: String, CodingKey {
            case description = "Description"
            case schema = "Schema"
            case tableName = "TableName"
            case tableProperties = "TableProperties"
        }
    }

    public struct ListExecutionsRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) for this export.
        public let exportArn: String
        /// The maximum number of objects that are returned for the request.
        public let maxResults: Int?
        /// The token to retrieve the next set of results.
        public let nextToken: String?

        @inlinable
        public init(exportArn: String, maxResults: Int? = nil, nextToken: String? = nil) {
            self.exportArn = exportArn
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.exportArn, name: "exportArn", parent: name, max: 2048)
            try self.validate(self.exportArn, name: "exportArn", parent: name, min: 20)
            try self.validate(self.exportArn, name: "exportArn", parent: name, pattern: "^arn:aws[-a-z0-9]*:[-a-z0-9]+:[-a-z0-9]*:[0-9]{12}:[-a-zA-Z0-9/:_]+$")
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 8192)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[\\S\\s]*$")
        }

        private enum CodingKeys: String, CodingKey {
            case exportArn = "ExportArn"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListExecutionsResponse: AWSDecodableShape {
        /// The list of executions.
        public let executions: [ExecutionReference]?
        /// The token to retrieve the next set of results.
        public let nextToken: String?

        @inlinable
        public init(executions: [ExecutionReference]? = nil, nextToken: String? = nil) {
            self.executions = executions
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case executions = "Executions"
            case nextToken = "NextToken"
        }
    }

    public struct ListExportsRequest: AWSEncodableShape {
        /// The maximum number of objects that are returned for the request.
        public let maxResults: Int?
        /// The token to retrieve the next set of results.
        public let nextToken: String?

        @inlinable
        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 8192)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[\\S\\s]*$")
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListExportsResponse: AWSDecodableShape {
        /// The details of the exports, including name and export status.
        public let exports: [ExportReference]?
        /// The token to retrieve the next set of results.
        public let nextToken: String?

        @inlinable
        public init(exports: [ExportReference]? = nil, nextToken: String? = nil) {
            self.exports = exports
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case exports = "Exports"
            case nextToken = "NextToken"
        }
    }

    public struct ListTablesRequest: AWSEncodableShape {
        /// The maximum number of objects that are returned for the request.
        public let maxResults: Int?
        /// The token to retrieve the next set of results.
        public let nextToken: String?

        @inlinable
        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 8192)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[\\S\\s]*$")
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListTablesResponse: AWSDecodableShape {
        /// The token to retrieve the next set of results.
        public let nextToken: String?
        /// The list of tables.
        public let tables: [Table]?

        @inlinable
        public init(nextToken: String? = nil, tables: [Table]? = nil) {
            self.nextToken = nextToken
            self.tables = tables
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case tables = "Tables"
        }
    }

    public struct ListTagsForResourceRequest: AWSEncodableShape {
        /// The maximum number of objects that are returned for the request.
        public let maxResults: Int?
        /// The token to retrieve the next set of results.
        public let nextToken: String?
        /// The unique identifier for the resource.
        public let resourceArn: String

        @inlinable
        public init(maxResults: Int? = nil, nextToken: String? = nil, resourceArn: String) {
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.resourceArn = resourceArn
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 8192)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[\\S\\s]*$")
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 2048)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 20)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:aws[-a-z0-9]*:[-a-z0-9]+:[-a-z0-9]*:[0-9]{12}:[-a-zA-Z0-9/:_]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case resourceArn = "ResourceArn"
        }
    }

    public struct ListTagsForResourceResponse: AWSDecodableShape {
        /// The token to retrieve the next set of results.
        public let nextToken: String?
        /// An optional list of tags to associate with the specified export. Each tag consists of a key and a value, and each key must be unique for the resource.
        public let resourceTags: [ResourceTag]?

        @inlinable
        public init(nextToken: String? = nil, resourceTags: [ResourceTag]? = nil) {
            self.nextToken = nextToken
            self.resourceTags = resourceTags
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case resourceTags = "ResourceTags"
        }
    }

    public struct RefreshCadence: AWSEncodableShape & AWSDecodableShape {
        /// The frequency that data exports are updated. The export refreshes each time the source data updates, up to three times daily.
        public let frequency: FrequencyOption

        @inlinable
        public init(frequency: FrequencyOption) {
            self.frequency = frequency
        }

        private enum CodingKeys: String, CodingKey {
            case frequency = "Frequency"
        }
    }

    public struct ResourceNotFoundException: AWSErrorShape {
        public let message: String
        /// The identifier of the resource that was not found.
        public let resourceId: String
        /// The type of the resource that was not found.
        public let resourceType: String

        @inlinable
        public init(message: String, resourceId: String, resourceType: String) {
            self.message = message
            self.resourceId = resourceId
            self.resourceType = resourceType
        }

        private enum CodingKeys: String, CodingKey {
            case message = "Message"
            case resourceId = "ResourceId"
            case resourceType = "ResourceType"
        }
    }

    public struct ResourceTag: AWSEncodableShape & AWSDecodableShape {
        /// The key that's associated with the tag.
        public let key: String
        /// The value that's associated with the tag.
        public let value: String

        @inlinable
        public init(key: String, value: String) {
            self.key = key
            self.value = value
        }

        public func validate(name: String) throws {
            try self.validate(self.key, name: "key", parent: name, max: 128)
            try self.validate(self.key, name: "key", parent: name, min: 1)
            try self.validate(self.value, name: "value", parent: name, max: 256)
        }

        private enum CodingKeys: String, CodingKey {
            case key = "Key"
            case value = "Value"
        }
    }

    public struct S3Destination: AWSEncodableShape & AWSDecodableShape {
        /// The name of the Amazon S3 bucket used as the destination of a data export file.
        public let s3Bucket: String
        /// The output configuration for the data export.
        public let s3OutputConfigurations: S3OutputConfigurations
        /// The S3 path prefix you want prepended to the name of your data export.
        public let s3Prefix: String
        /// The S3 bucket Region.
        public let s3Region: String

        @inlinable
        public init(s3Bucket: String, s3OutputConfigurations: S3OutputConfigurations, s3Prefix: String, s3Region: String) {
            self.s3Bucket = s3Bucket
            self.s3OutputConfigurations = s3OutputConfigurations
            self.s3Prefix = s3Prefix
            self.s3Region = s3Region
        }

        public func validate(name: String) throws {
            try self.validate(self.s3Bucket, name: "s3Bucket", parent: name, max: 1024)
            try self.validate(self.s3Bucket, name: "s3Bucket", parent: name, pattern: "^[\\S\\s]*$")
            try self.validate(self.s3Prefix, name: "s3Prefix", parent: name, max: 1024)
            try self.validate(self.s3Prefix, name: "s3Prefix", parent: name, pattern: "^[\\S\\s]*$")
            try self.validate(self.s3Region, name: "s3Region", parent: name, max: 1024)
            try self.validate(self.s3Region, name: "s3Region", parent: name, pattern: "^[\\S\\s]*$")
        }

        private enum CodingKeys: String, CodingKey {
            case s3Bucket = "S3Bucket"
            case s3OutputConfigurations = "S3OutputConfigurations"
            case s3Prefix = "S3Prefix"
            case s3Region = "S3Region"
        }
    }

    public struct S3OutputConfigurations: AWSEncodableShape & AWSDecodableShape {
        /// The compression type for the data export.
        public let compression: CompressionOption
        /// The file format for the data export.
        public let format: FormatOption
        /// The output type for the data export.
        public let outputType: S3OutputType
        /// The rule to follow when generating a version of the data export file. You have the choice to overwrite the previous version or to be delivered in addition to the previous versions. Overwriting exports can save on Amazon S3 storage costs. Creating new export versions allows you to track the changes in cost and usage data over time.
        public let overwrite: OverwriteOption

        @inlinable
        public init(compression: CompressionOption, format: FormatOption, outputType: S3OutputType, overwrite: OverwriteOption) {
            self.compression = compression
            self.format = format
            self.outputType = outputType
            self.overwrite = overwrite
        }

        private enum CodingKeys: String, CodingKey {
            case compression = "Compression"
            case format = "Format"
            case outputType = "OutputType"
            case overwrite = "Overwrite"
        }
    }

    public struct ServiceQuotaExceededException: AWSErrorShape {
        public let message: String
        /// The quota code that was exceeded.
        public let quotaCode: String
        /// The identifier of the resource that exceeded quota.
        public let resourceId: String?
        /// The type of the resource that exceeded quota.
        public let resourceType: String?
        /// The service code that exceeded quota. It will always be “AWSBillingAndCostManagementDataExports”.
        public let serviceCode: String

        @inlinable
        public init(message: String, quotaCode: String, resourceId: String? = nil, resourceType: String? = nil, serviceCode: String) {
            self.message = message
            self.quotaCode = quotaCode
            self.resourceId = resourceId
            self.resourceType = resourceType
            self.serviceCode = serviceCode
        }

        private enum CodingKeys: String, CodingKey {
            case message = "Message"
            case quotaCode = "QuotaCode"
            case resourceId = "ResourceId"
            case resourceType = "ResourceType"
            case serviceCode = "ServiceCode"
        }
    }

    public struct Table: AWSDecodableShape {
        /// The description for the table.
        public let description: String?
        /// The name of the table.
        public let tableName: String?
        /// The properties for the table.
        public let tableProperties: [TablePropertyDescription]?

        @inlinable
        public init(description: String? = nil, tableName: String? = nil, tableProperties: [TablePropertyDescription]? = nil) {
            self.description = description
            self.tableName = tableName
            self.tableProperties = tableProperties
        }

        private enum CodingKeys: String, CodingKey {
            case description = "Description"
            case tableName = "TableName"
            case tableProperties = "TableProperties"
        }
    }

    public struct TablePropertyDescription: AWSDecodableShape {
        /// The default value for the table.
        public let defaultValue: String?
        /// The description for the table.
        public let description: String?
        /// The name of the table.
        public let name: String?
        /// The valid values for the table.
        public let validValues: [String]?

        @inlinable
        public init(defaultValue: String? = nil, description: String? = nil, name: String? = nil, validValues: [String]? = nil) {
            self.defaultValue = defaultValue
            self.description = description
            self.name = name
            self.validValues = validValues
        }

        private enum CodingKeys: String, CodingKey {
            case defaultValue = "DefaultValue"
            case description = "Description"
            case name = "Name"
            case validValues = "ValidValues"
        }
    }

    public struct TagResourceRequest: AWSEncodableShape {
        /// The unique identifier for the resource.
        public let resourceArn: String
        /// The tags to associate with the resource. Each tag consists of a key and a value, and each key must be unique for the resource.
        public let resourceTags: [ResourceTag]

        @inlinable
        public init(resourceArn: String, resourceTags: [ResourceTag]) {
            self.resourceArn = resourceArn
            self.resourceTags = resourceTags
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 2048)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 20)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:aws[-a-z0-9]*:[-a-z0-9]+:[-a-z0-9]*:[0-9]{12}:[-a-zA-Z0-9/:_]+$")
            try self.resourceTags.forEach {
                try $0.validate(name: "\(name).resourceTags[]")
            }
            try self.validate(self.resourceTags, name: "resourceTags", parent: name, max: 200)
        }

        private enum CodingKeys: String, CodingKey {
            case resourceArn = "ResourceArn"
            case resourceTags = "ResourceTags"
        }
    }

    public struct TagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct ThrottlingException: AWSErrorShape {
        public let message: String
        /// The quota code that exceeded the throttling limit.
        public let quotaCode: String?
        /// The service code that exceeded the throttling limit. It will always be “AWSBillingAndCostManagementDataExports”.
        public let serviceCode: String?

        @inlinable
        public init(message: String, quotaCode: String? = nil, serviceCode: String? = nil) {
            self.message = message
            self.quotaCode = quotaCode
            self.serviceCode = serviceCode
        }

        private enum CodingKeys: String, CodingKey {
            case message = "Message"
            case quotaCode = "QuotaCode"
            case serviceCode = "ServiceCode"
        }
    }

    public struct UntagResourceRequest: AWSEncodableShape {
        /// The unique identifier for the resource.
        public let resourceArn: String
        /// The tag keys that are associated with the resource ARN.
        public let resourceTagKeys: [String]

        @inlinable
        public init(resourceArn: String, resourceTagKeys: [String]) {
            self.resourceArn = resourceArn
            self.resourceTagKeys = resourceTagKeys
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 2048)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 20)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:aws[-a-z0-9]*:[-a-z0-9]+:[-a-z0-9]*:[0-9]{12}:[-a-zA-Z0-9/:_]+$")
            try self.resourceTagKeys.forEach {
                try validate($0, name: "resourceTagKeys[]", parent: name, max: 128)
                try validate($0, name: "resourceTagKeys[]", parent: name, min: 1)
            }
            try self.validate(self.resourceTagKeys, name: "resourceTagKeys", parent: name, max: 200)
        }

        private enum CodingKeys: String, CodingKey {
            case resourceArn = "ResourceArn"
            case resourceTagKeys = "ResourceTagKeys"
        }
    }

    public struct UntagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UpdateExportRequest: AWSEncodableShape {
        /// The name and query details for the export.
        public let export: Export
        /// The Amazon Resource Name (ARN) for this export.
        public let exportArn: String

        @inlinable
        public init(export: Export, exportArn: String) {
            self.export = export
            self.exportArn = exportArn
        }

        public func validate(name: String) throws {
            try self.export.validate(name: "\(name).export")
            try self.validate(self.exportArn, name: "exportArn", parent: name, max: 2048)
            try self.validate(self.exportArn, name: "exportArn", parent: name, min: 20)
            try self.validate(self.exportArn, name: "exportArn", parent: name, pattern: "^arn:aws[-a-z0-9]*:[-a-z0-9]+:[-a-z0-9]*:[0-9]{12}:[-a-zA-Z0-9/:_]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case export = "Export"
            case exportArn = "ExportArn"
        }
    }

    public struct UpdateExportResponse: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) for this export.
        public let exportArn: String?

        @inlinable
        public init(exportArn: String? = nil) {
            self.exportArn = exportArn
        }

        private enum CodingKeys: String, CodingKey {
            case exportArn = "ExportArn"
        }
    }

    public struct ValidationException: AWSErrorShape {
        /// The list of fields that are invalid.
        public let fields: [ValidationExceptionField]?
        public let message: String
        /// The reason for the validation exception.
        public let reason: ValidationExceptionReason?

        @inlinable
        public init(fields: [ValidationExceptionField]? = nil, message: String, reason: ValidationExceptionReason? = nil) {
            self.fields = fields
            self.message = message
            self.reason = reason
        }

        private enum CodingKeys: String, CodingKey {
            case fields = "Fields"
            case message = "Message"
            case reason = "Reason"
        }
    }

    public struct ValidationExceptionField: AWSDecodableShape {
        /// A message with the reason for the validation exception error.
        public let message: String
        /// The field name where the invalid entry was detected.
        public let name: String

        @inlinable
        public init(message: String, name: String) {
            self.message = message
            self.name = name
        }

        private enum CodingKeys: String, CodingKey {
            case message = "Message"
            case name = "Name"
        }
    }
}

// MARK: - Errors

/// Error enum for BCMDataExports
public struct BCMDataExportsErrorType: AWSErrorType {
    enum Code: String {
        case internalServerException = "InternalServerException"
        case resourceNotFoundException = "ResourceNotFoundException"
        case serviceQuotaExceededException = "ServiceQuotaExceededException"
        case throttlingException = "ThrottlingException"
        case validationException = "ValidationException"
    }

    private let error: Code
    public let context: AWSErrorContext?

    /// initialize BCMDataExports
    public init?(errorCode: String, context: AWSErrorContext) {
        guard let error = Code(rawValue: errorCode) else { return nil }
        self.error = error
        self.context = context
    }

    internal init(_ error: Code) {
        self.error = error
        self.context = nil
    }

    /// return error code string
    public var errorCode: String { self.error.rawValue }

    /// An error on the server occurred during the processing of your request. Try again later.
    public static var internalServerException: Self { .init(.internalServerException) }
    /// The specified Amazon Resource Name (ARN) in the request doesn't exist.
    public static var resourceNotFoundException: Self { .init(.resourceNotFoundException) }
    /// You've reached the limit on the number of resources you can create, or exceeded the size of an individual resource.
    public static var serviceQuotaExceededException: Self { .init(.serviceQuotaExceededException) }
    /// The request was denied due to request throttling.
    public static var throttlingException: Self { .init(.throttlingException) }
    /// The input fails to satisfy the constraints specified by an Amazon Web Services service.
    public static var validationException: Self { .init(.validationException) }
}

extension BCMDataExportsErrorType: AWSServiceErrorType {
    public static let errorCodeMap: [String: AWSErrorShape.Type] = [
        "ResourceNotFoundException": BCMDataExports.ResourceNotFoundException.self,
        "ServiceQuotaExceededException": BCMDataExports.ServiceQuotaExceededException.self,
        "ThrottlingException": BCMDataExports.ThrottlingException.self,
        "ValidationException": BCMDataExports.ValidationException.self
    ]
}

extension BCMDataExportsErrorType: Equatable {
    public static func == (lhs: BCMDataExportsErrorType, rhs: BCMDataExportsErrorType) -> Bool {
        lhs.error == rhs.error
    }
}

extension BCMDataExportsErrorType: CustomStringConvertible {
    public var description: String {
        return "\(self.error.rawValue): \(self.message ?? "")"
    }
}
